package com.xjm.bean.aware;

import com.AnnotationContextDemo;
import com.xjm.model.Person;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author jaymin
 * 2021/1/10 16:45
 */
public class AwareDemo {
	public static void main(String[] args) {
		// 模拟容器启动，这里不直接使用该applicationContext,仅做组件扫描使用
		ApplicationContext applicationContext = new AnnotationConfigApplicationContext(AnnotationContextDemo.class);
		Person person = SpringContextUtil.getBean("person", Person.class);
		System.out.println("通过Aware接口获取 person 对象:" + person.toString());
	}
}
